FIX: Input State Window is now force-closed when the device it is inspecting is disconnected #2093
+27
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes ISXB-658.
The
InputStateWindow
currently caches a bunch of state. When a device is disconnected, then reconnected, this state is reused. It is possible - likely based on the specifics of the device - that this will cause the window tomemcpy
from or into memory no longer owned by the device or the window leading to an editor crash.To resolve this, I've used the same strategy used for the Input debugger window; when the device is disconnected - the window is force-closed.
Testing status & QA
I tested this locally using a Stadia controller, but it would be great to get some wider testing of devices on this before merging. Although I certainly don't see this as high risk.
Overall Product Risks
Comments to reviewers
The changes in
DrawHexDump
were to resolve some spammy null reference exception errors caused by the window. I believe it to be now unlikely that we'd run into a case where null reference exceptions are thrown during the drawing of the window, but there is no harm in doing these checks.Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: